/*
 * This file is part of aKoustiK.

 * aKoustiK is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * aKoustiK is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with aKoustiK.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <item.h>

Item::Item() {
}

Item::Item(const KUrl& url) {
    mUrl = url;
    mTitle = url.fileName();
}

Item::~Item() {
}

bool Item::operator ==(const Item& other) const {
    return mUrl == other.mUrl;
}

bool Item::operator ==(const KUrl& url) const {
    return mUrl == url;
}

bool Item::operator !=(const Item& other) const {
    return mUrl != other.mUrl;
}

bool Item::operator !=(const KUrl& url) const {
    return mUrl != url;
}

Item& Item::operator =(const Item& other) {
    mUrl = other.url();
    mAlbum = other.album();
    mArtist = other.artist();
    mDuration = other.duration();
    mTitle = other.title();
    mYear = other.year();
    return *this;
}

bool Item::isValid() const {
    return (!mUrl.isEmpty() && mUrl.isValid());
}

const QString& Item::album() const {
    return mAlbum;
}

const QString& Item::artist() const {
    return mArtist;
}

const QString& Item::duration() const {
    return mDuration;
}

const QString& Item::title() const {
    return mTitle;
}

const KUrl& Item::url() const {
    return mUrl;
}

const QString& Item::year() const {
    return mYear;
}

int Item::durationSeconds() const {
    return mDurationSeconds;
}

void Item::setAlbum(const QString &value) {
    mAlbum = value;
}

void Item::setArtist(const QString &value) {
    mArtist = value;
}

void Item::setDuration(const QString &value) {
    mDuration = value;
}

void Item::setTitle(const QString &value) {
    mTitle = value;
}

void Item::setUrl(const KUrl &value) {
    mUrl = value;
}

void Item::setYear(const QString &value) {
    mYear = value;
}

void Item::setDurationSeconds(const int value) {
    mDurationSeconds = value;
}
